#!/usr/bin/perl


## main ################################################################

$ARGC = @ARGV;
$argp = 0;

$N=5;
$PROG=echo;
$PARS="a b c";

$out="/tmp/out.$$";

$i=1;

for ($i = 0; $i < $N; $i++) {

	print "Run $i:\n";
	system("/usr/bin/time $PROG $PARS > $out");
	if ( -e $out ) {
		if (!`cmp "out.$PROG.$PARS" "$out"`) {
		   print "Correct Execution\n\n";
		}
		else {
	           print "Wrong Execution\n\n";	
                }
	}
	else {
		print "There is not output file out.$PROG.$PARS to compare to\n";
        }
	system("rm -f $out");
}

